// *Author：jxx
// *Contact：283591387@qq.com
// *代码由框架生成,任何更改都可能导致被代码生成器覆盖
export default function(){
    const table = {
        key: 'Id',
        footer: "Foots",
        cnName: '车间设置',
        name: 'WorkShopSetting',
        url: "/WorkShopSetting/",
        sortName: "Id"
    };
    const tableName = table.name;
    const tableCNName = table.cnName;
    const newTabEdit = false;
    const key = table.key;
    const editFormFields = {
        "WorkshopCode":"",
        "WorkshopName":"",
        "Area":"",
        "Principal":"",
        "Status":"",
        "Descs":"",
        "AutoGenerate": true,  // 自动生成编号开关
        "CodeFormatType": 3    // 编号格式类型：1=年月日，2=年月日时分，3=年月日时分秒
    };
    const editFormOptions = [
        [
            {"title":"车间编码","field":"WorkshopCode","type":"text"},
            {"title":"自动生成","field":"AutoGenerate","type":"switch"}
        ],
        [
            {"title":"编号格式选择","field":"CodeFormatType","type":"slider", 
             "min": 1, "max": 3, "step": 1, "marks": {"1":"年月日","2":"年月日时分","3":"年月日时分秒"}, 
             "hidden": () => !editFormFields.AutoGenerate}
        ],
        [{"title":"车间名称","field":"WorkshopName","type":"text"}],
        [{"title":"面积","field":"Area","type":"text"}],
        [{"title":"负责人","field":"Principal","type":"text"}],
        [{"dataKey":"状态01","data":[],"title":"状态","field":"Status","type":"radio"}],
        [{"title":"备注","field":"Descs","type":"textarea"}]
    ];
    const searchFormFields = {"WorkshopCode":"","WorkshopName":""};
    const searchFormOptions = [[{"title":"车间编码","field":"WorkshopCode","type":"like"}],[{"title":"车间名称","field":"WorkshopName","type":"like"}]];
    const columns = [{field:'Id',title:'主键',type:'int',width:120,require:true,align:'left'},
                       {field:'WorkshopCode',title:'车间编码',type:'string',width:120,align:'left'},
                       {field:'WorkshopName',title:'车间名称',type:'string',width:120,align:'left'},
                       {field:'Area',title:'面积',type:'string',width:120,align:'left'},
                       {field:'Principal',title:'负责人',type:'string',width:120,align:'left'},
                       {field:'Status',title:'状态',type:'int',bind:{ key:'状态01',data:[]},width:120,align:'left'},
                       {field:'Descs',title:'备注',type:'string',width:120,align:'left'}];
    const detail ={columns:[]};
    const details = [];

    return {
        table,
        key,
        tableName,
        tableCNName,
        newTabEdit,
        editFormFields,
        editFormOptions,
        searchFormFields,
        searchFormOptions,
        columns,
        detail,
        details
    };
}